
package com.sailing.lianxi.design.observer;

public class ObserverPatternDemo {

    public static void main(String[] args) {
        Subject subject = new Subject();
        new BinaryObserver(subject);
        new OctalObserver(subject);
        new HexaObserver(subject);
        System.out.println("first state 15");
        subject.setState(15);
        System.out.println("------------------------------------------");
        System.out.println("second state change:10");
        subject.setState(10);
    }
}

